<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>车队申请结算管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			//$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/ordersettle/tOrdersSettle/buslist">结算列表</a></li>
		<li class="active"><a href="${ctx}/ordersettle/tOrdersSettle/applyform">申请结算</a></li>
	</ul><br/>
	<table class="table table-striped table-bordered table-condensed">
		<thead>
			<tr class="success">
				<th>订单号</th>
				<th>订单名称</th>
				<th>完单日期</th>
				<th>订单状态</th>
				<th>处理原因</th>
				<th>结算金额</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${orderlist}" var="orders">
			<tr>
				<td>${orders.orderid }</td>
				<td>${orders.ordername }<c:if test="${orders.istrouble == '1' }"><font title="${orders.reason }"><img src="${ctxStatic }/xiake/images/warn.png"/></font></c:if></td>
				<td><fmt:formatDate value="${orders.checkdate }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
				<td>${fns:getDictLabel(orders.orderstatus, 'orderstatus', '无')}
				<td>${fns:getDictLabel(orders.settlereason, 'settlereason', '无')}
				<td>${orders.settlemoney }</td>
			</tr>
			</c:forEach>
		</tbody>
	</table>
	<div class="control-group" style='background:#7093DB;'>
		<font color="#FFFFFF" size='3'>&nbsp;&nbsp;结算信息</font>
	</div>
	<div class="control-group"></div>
	<form:form id="inputForm" modelAttribute="tOrdersSettle" action="${ctx}/ordersettle/tOrdersSettle/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<form:hidden path="settleid"/>
		<sys:message content="${message}"/>		
		<div class="control-group">
			<label class="control-label">账户名称：</label>
			<div class="controls">
				<form:input path="acctname" htmlEscape="false" maxlength="100" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">开户银行：</label>
			<div class="controls">
				<form:input path="bankname" htmlEscape="false" maxlength="50" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">银行账号：</label>
			<div class="controls">
				<form:input path="bankaccount" htmlEscape="false" maxlength="50" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">开票抬头：</label>
			<div class="controls">
				<form:input path="title" htmlEscape="false" maxlength="50" readonly="true" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">开票总金额：</label>
			<div class="controls">
				<form:input path="settlemoney" htmlEscape="false"  readonly="true" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">开票内容：</label>
			<div class="controls">
				<form:input path="rcptcontent" htmlEscape="false" maxlength="100" readonly="true" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="form-actions">
			<shiro:hasPermission name="ordersettle:tOrdersSettle:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="提交申请"/>&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>